package com.sqm.baidumaplib;

import android.content.Context;

import com.baidu.location.LocationClientOption;
import com.baidu.mapapi.SDKInitializer;

/**
 * Created by Kvin on 2017/4/28.
 */
public class MapHelper {

    /**
     * create a default location option
     */
    public static LocationClientOption getDefaultOptions() {
        LocationClientOption option = new LocationClientOption();
        option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
        option.setOpenGps(true);
        option.setIsNeedLocationPoiList(true);//设置是否返回定位位置信息
        option.setIsNeedAddress(true);//
        option.setCoorType(CoorType.BD09LL);//设置坐标类型
        option.setScanSpan(3000);//发起定位的时间间隔；time<1000时，设置没有意义
        return option;
    }

    /**
     * map initialize
     * must init application context
     */
    public static void initSDK(Context context){
        SDKInitializer.initialize(context);
    }


    /**
     * coordination type
     */
    public static class CoorType{
        public static final String GCJ02="gcj02";//国测局经纬度坐标系
        public static final String BD09 ="bd09";//百度墨卡托坐标系
        public static final String BD09LL="bd09ll";//attention:differences between number 1 and the low word L
    }
}
